< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03030102.xhp

(section: datevalue) (bookmark: bm_id3156344)
DateValue function

DateValue; 関数

DateValue Function [Runtime]
DateValue 関数 [実行時](hd_id3156344.1)

Returns a date value from a date string. The date string is a complete date in a single numeric value. You can also use this serial number to determine the difference between two dates.
日付文字列から日付の値を返します。日付文字列は 1 つの数値で表される完全な日付です。このシリアル値を使用して、2 つの日付の間の差を調べることもできます。(par_id3150542.2)

(/section: datevalue)

Syntax:
構文:(hd_id3148799.3)

DateValue [(date)]
DateValue [(date)](par_id3154910.4)

Return value:
戻り値:(hd_id3150870.5)

Date
日付(par_id3153194.6)

Parameters:
パラメータ:(hd_id3153969.7)

Date: String expression that contains the date that you want to calculate. The date can be specified in almost any format.
Date: 変換する日付データを示す文字列表式。日付を示す書式は、各種のフォーマットが使用できます。(par_id3153770.8)

You can use this function to convert a date that occurs between December 1, 1582 and December 31, 9999 into a single integer value. You can then use this value to calculate the difference between two dates. If the date argument lies outside the acceptable range, Office Basic returns an error message.
この関数の変換範囲は 1582 年 12 月 1 日から 9999 年 12 月 31 日までの日付で、これらの日付を該当する数値に変換します。こうして変換される数値を用いると、異なる日付間の日数計算などが行えます。なお引数に指定した日付が上記の範囲を超えている場合、Office Basic はエラーメッセージを表示します。(par_id3153189.22)

In contrast to the DateSerial function that passes years, months, and days as separate numeric values, the DateValue function passes the date using the format "month.[,]day.[,]year".
DateSerial 関数の場合は年、月、日を個別の値として指定するのに対して、DateValue 関数の場合は「年.[,]月.[,]日」の形式で一括して指定します。(par_id3146974.23)

(embed text/sbasic/shared/00000003.xhp#languageformat : linkinfo)

You can set the locale used for controlling the formatting numbers, dates and currencies in Office Basic in (in case of MAC)Office - Preferences(/in case of MAC)(in other case)Tools - Options(/in other case) - Language Settings - Languages. In Basic format codes, the decimal point (.) is always used as placeholder for the decimal separator defined in your locale and will be replaced by the corresponding character.
[PO-fuzzy@sbasic\shared.po] ※※※未訳※※※(par_id3153381.102)

The same applies to the locale settings for date, time and currency formats. The Basic format code will be interpreted and displayed according to your locale setting.
これは、日付、時間、通貨の書式設定とロケールの関係についても同様です。Basic の書式コードは、個々のロケール設定に応じて、適切な表示に変換されます。(par_id3150870.103)

(/embed text/sbasic/shared/00000003.xhp#languageformat)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3153142.24)

Sub ExampleDateValue
Sub ExampleDateValue(par_id3155412.25)

msgbox DateValue("12/02/1997")
msgbox DateValue("1997/12/02")(par_id3153363.26)

end sub
end sub(par_id3149262.27)


< Prev / Next >